home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / contrib / pgperl / pg-perl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  16.4 KB  |  730 lines

  1. /* $Header: /private/postgres/src/contrib/pgperl/RCS/pg-perl.h,v 1.1 1990/10/24 20:31:16 cimarron Exp $
  2.  *
  3.  *    Copyright (c) 1989, Larry Wall
  4.  *
  5.  *    You may distribute under the terms of the GNU General Public License
  6.  *    as specified in the README file that comes with the perl 3.0 kit.
  7.  *
  8.  * $Log: pg-perl.h,v $
  9.  * Revision 1.1  1990/10/24  20:31:16  cimarron
  10.  * Initial revision
  11.  *
  12.  * Revision 3.0.1.8  90/08/09  04:10:53  lwall
  13.  * patch19: various MSDOS and OS/2 patches folded in
  14.  * patch19: did preliminary work toward debugging packages and evals
  15.  * patch19: added -x switch to extract script from input trash
  16.  * 
  17.  * Revision 3.0.1.7  90/03/27  16:12:52  lwall
  18.  * patch16: MSDOS support
  19.  * patch16: support for machines that can't cast negative floats to unsigned ints
  20.  * 
  21.  * Revision 3.0.1.6  90/03/12  16:40:43  lwall
  22.  * patch13: did some ndir straightening up for Xenix
  23.  * 
  24.  * Revision 3.0.1.5  90/02/28  17:52:28  lwall
  25.  * patch9: Configure now determines whether volatile is supported
  26.  * patch9: volatilized some more variables for super-optimizing compilers
  27.  * patch9: unused VREG symbol deleted
  28.  * patch9: perl can now start up other interpreters scripts  
  29.  * patch9: you may now undef $/ to have no input record separator
  30.  * patch9: nested evals clobbered their longjmp environment
  31.  * 
  32.  * Revision 3.0.1.4  89/12/21  20:07:35  lwall
  33.  * patch7: arranged for certain registers to be restored after longjmp()
  34.  * patch7: Configure now compiles a test program to figure out time.h fiasco
  35.  * patch7: Configure now detects DG/UX thingies like [sg]etpgrp2 and utime.h
  36.  * patch7: memcpy() and memset() return void in __STDC__
  37.  * patch7: errno may now be a macro with an lvalue
  38.  * patch7: ANSI strerror() is now supported
  39.  * patch7: Xenix support for sys/ndir.h, cross compilation
  40.  * 
  41.  * Revision 3.0.1.3  89/11/17  15:28:57  lwall
  42.  * patch5: byteorder now is a hex value
  43.  * patch5: Configure now looks for <time.h> including <sys/time.h>
  44.  * 
  45.  * Revision 3.0.1.2  89/11/11  04:39:38  lwall
  46.  * patch2: Configure may now set -DDEBUGGING
  47.  * patch2: netinet/in.h needed sys/types.h some places
  48.  * patch2: more <sys/time.h> and <time.h> wrangling
  49.  * patch2: yydebug moved to where type doesn't matter  
  50.  * 
  51.  * Revision 3.0.1.1  89/10/26  23:17:08  lwall
  52.  * patch1: vfork now conditionally defined based on VFORK
  53.  * patch1: DEC risc machines have a buggy memcmp
  54.  * patch1: perl.h now includes <netinet/in.h> if it exists
  55.  * 
  56.  * Revision 3.0  89/10/18  15:21:21  lwall
  57.  * 3.0 baseline
  58.  * 
  59.  */
  60.  
  61. #define VOIDUSED 1
  62. #include "config.h"
  63.  
  64. #ifdef MSDOS
  65. /*
  66.  * BUGGY_MSC:
  67.  *    This symbol is defined if you are the unfortunate owner of a buggy
  68.  *    Microsoft C compiler and want to use intrinsic functions.  Versions
  69.  *    up to 5.1 are known conform to this definition.  This is not needed
  70.  *    under Unix.
  71.  */
  72. #define BUGGY_MSC            /**/
  73. /*
  74.  * BINARY:
  75.  *    This symbol is defined if you run under an operating system that
  76.  *    distinguishes between binary and text files.  If so the function
  77.  *    setmode will be used to set the file into binary mode.  Unix
  78.  *    doesn't distinguish.
  79.  */
  80. #define BINARY                /**/
  81.  
  82. #else /* !MSDOS */
  83.  
  84. /*
  85.  * The following symbols are defined if your operating system supports
  86.  * functions by that name.  All Unixes I know of support them, thus they
  87.  * are not checked by the configuration script, but are directly defined
  88.  * here.
  89.  */
  90. #define CHOWN
  91. #define CHROOT
  92. #define FORK
  93. #define GETLOGIN
  94. #define GETPPID
  95. #define KILL
  96. #define LINK
  97. #define PIPE
  98. #define WAIT
  99. #define UMASK
  100. /*
  101.  * The following symbols are defined if your operating system supports
  102.  * password and group functions in general.  All Unix systems do.
  103.  */
  104. #define GROUP
  105. #define PASSWD
  106.  
  107. #endif /* !MSDOS */
  108.  
  109. #if defined(HASVOLATILE) || defined(__STDC__)
  110. #define VOLATILE volatile
  111. #else
  112. #define VOLATILE
  113. #endif
  114.  
  115. #ifdef IAMSUID
  116. #   ifndef TAINT
  117. #    define TAINT
  118. #   endif
  119. #endif
  120.  
  121. #ifndef VFORK
  122. #   define vfork fork
  123. #endif
  124.  
  125. #ifdef GETPGRP2
  126. #   ifndef GETPGRP
  127. #    define GETPGRP
  128. #   endif
  129. #   define getpgrp getpgrp2
  130. #endif
  131.  
  132. #ifdef SETPGRP2
  133. #   ifndef SETPGRP
  134. #    define SETPGRP
  135. #   endif
  136. #   define setpgrp setpgrp2
  137. #endif
  138.  
  139. #if defined(MEMCMP) && defined(mips) && BYTEORDER == 0x1234
  140. #undef MEMCMP
  141. #endif
  142.  
  143. #ifdef MEMCPY
  144. #ifndef memcpy
  145. #if defined(__STDC__ ) || defined(MSDOS)
  146. extern void *memcpy(), *memset();
  147. #else
  148. extern char *memcpy(), *memset();
  149. #endif
  150. extern int memcmp();
  151. #endif
  152. #define bcopy(s1,s2,l) memcpy(s2,s1,l)
  153. #define bzero(s,l) memset(s,0,l)
  154. #endif
  155. #ifndef BCMP        /* prefer bcmp slightly 'cuz it doesn't order */
  156. #define bcmp(s1,s2,l) memcmp(s1,s2,l)
  157. #endif
  158.  
  159. #include <stdio.h>
  160. #include <ctype.h>
  161. #include <sys/param.h>    /* if this needs types.h we're still wrong */
  162.  
  163. #ifndef _TYPES_        /* If types.h defines this it's easy. */
  164. #ifndef major        /* Does everyone's types.h define this? */
  165. #include <sys/types.h>
  166. #endif
  167. #endif
  168.  
  169. #ifdef I_NETINET_IN
  170. #include <netinet/in.h>
  171. #endif
  172.  
  173. #include <sys/stat.h>
  174.  
  175. #ifdef I_TIME
  176. #   include <time.h>
  177. #endif
  178.  
  179. #ifdef I_SYSTIME
  180. #   ifdef SYSTIMEKERNEL
  181. #    define KERNEL
  182. #   endif
  183. #   include <sys/time.h>
  184. #   ifdef SYSTIMEKERNEL
  185. #    undef KERNEL
  186. #   endif
  187. #endif
  188.  
  189. #include <sys/times.h>
  190.  
  191. #if defined(STRERROR) && (!defined(MKDIR) || !defined(RMDIR))
  192. #undef STRERROR
  193. #endif
  194.  
  195. #include <errno.h>
  196. #ifndef errno
  197. extern int errno;     /* ANSI allows errno to be an lvalue expr */
  198. #endif
  199.  
  200. #ifdef STRERROR
  201. char *strerror();
  202. #else
  203. extern int sys_nerr;
  204. extern char *sys_errlist[];
  205. #define strerror(e) ((e) < 0 || (e) >= sys_nerr ? "(unknown)" : sys_errlist[e])
  206. #endif
  207.  
  208. #ifdef I_SYSIOCTL
  209. #ifndef _IOCTL_
  210. #include <sys/ioctl.h>
  211. #endif
  212. #endif
  213.  
  214. #if defined(mc300) || defined(mc500) || defined(mc700)    /* MASSCOMP */
  215. #ifdef SOCKETPAIR
  216. #undef SOCKETPAIR
  217. #endif
  218. #ifdef NDBM
  219. #undef NDBM
  220. #endif
  221. #endif
  222.  
  223. #ifdef NDBM
  224. #include <ndbm.h>
  225. #define SOME_DBM
  226. #ifdef ODBM
  227. #undef ODBM
  228. #endif
  229. #else
  230. #ifdef ODBM
  231. #ifdef NULL
  232. #undef NULL        /* suppress redefinition message */
  233. #endif
  234. #include <dbm.h>
  235. #ifdef NULL
  236. #undef NULL
  237. #endif
  238. #define NULL 0        /* silly thing is, we don't even use this */
  239. #define SOME_DBM
  240. #define dbm_fetch(db,dkey) fetch(dkey)
  241. #define dbm_delete(db,dkey) delete(dkey)
  242. #define dbm_store(db,dkey,dcontent,flags) store(dkey,dcontent)
  243. #define dbm_close(db) dbmclose()
  244. #define dbm_firstkey(db) firstkey()
  245. #endif /* ODBM */
  246. #endif /* NDBM */
  247. #ifdef SOME_DBM
  248. EXT char *dbmkey;
  249. EXT int dbmlen;
  250. #endif
  251.  
  252. #if INTSIZE == 2
  253. #define htoni htons
  254. #define ntohi ntohs
  255. #else
  256. #define htoni htonl
  257. #define ntohi ntohl
  258. #endif
  259.  
  260. #if defined(I_DIRENT) && !defined(M_XENIX)
  261. #   include <dirent.h>
  262. #   define DIRENT dirent
  263. #else
  264. #   ifdef I_SYSNDIR
  265. #    include <sys/ndir.h>
  266. #    define DIRENT direct
  267. #   else
  268. #    ifdef I_SYSDIR
  269. #        ifdef hp9000s500
  270. #        include <ndir.h>    /* may be wrong in the future */
  271. #        else
  272. #        include <sys/dir.h>
  273. #        endif
  274. #        define DIRENT direct
  275. #    endif
  276. #   endif
  277. #endif
  278.  
  279. typedef unsigned int STRLEN;
  280.  
  281. typedef struct arg ARG;
  282. typedef struct cmd CMD;
  283. typedef struct formcmd FCMD;
  284. typedef struct scanpat SPAT;
  285. typedef struct stio STIO;
  286. typedef struct sub SUBR;
  287. typedef struct string STR;
  288. typedef struct atbl ARRAY;
  289. typedef struct htbl HASH;
  290. typedef struct regexp REGEXP;
  291. typedef struct stabptrs STBP;
  292. typedef struct stab STAB;
  293.  
  294. #include "handy.h"
  295. #include "regexp.h"
  296. #include "str.h"
  297. #include "util.h"
  298. #include "form.h"
  299. #include "stab.h"
  300. #include "spat.h"
  301. #include "arg.h"
  302. #include "cmd.h"
  303. #include "array.h"
  304. #include "hash.h"
  305.  
  306. #if defined(iAPX286) || defined(M_I286) || defined(I80286)
  307. #   define I286
  308. #endif
  309.  
  310. #ifndef    __STDC__
  311. #ifdef CHARSPRINTF
  312.     char *sprintf();
  313. #else
  314.     int sprintf();
  315. #endif
  316. #endif
  317.  
  318. EXT char *Yes INIT("1");
  319. EXT char *No INIT("");
  320.  
  321. /* "gimme" values */
  322.  
  323. /* Note: cmd.c assumes that it can use && to produce one of these values! */
  324. #define G_SCALAR 0
  325. #define G_ARRAY 1
  326.  
  327. #ifdef CRIPPLED_CC
  328. int str_true();
  329. #else /* !CRIPPLED_CC */
  330. #define str_true(str) (Str = (str), \
  331.     (Str->str_pok ? \
  332.         ((*Str->str_ptr > '0' || \
  333.           Str->str_cur > 1 || \
  334.           (Str->str_cur && *Str->str_ptr != '0')) ? 1 : 0) \
  335.     : \
  336.         (Str->str_nok ? (Str->str_u.str_nval != 0.0) : 0 ) ))
  337. #endif /* CRIPPLED_CC */
  338.  
  339. #ifdef DEBUGGING
  340. #define str_peek(str) (Str = (str), \
  341.     (Str->str_pok ? \
  342.         Str->str_ptr : \
  343.         (Str->str_nok ? \
  344.         (sprintf(tokenbuf,"num(%g)",Str->str_u.str_nval), \
  345.             (char*)tokenbuf) : \
  346.         "" )))
  347. #endif
  348.  
  349. #ifdef CRIPPLED_CC
  350. char *str_get();
  351. #else
  352. #ifdef TAINT
  353. #define str_get(str) (Str = (str), tainted |= Str->str_tainted, \
  354.     (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
  355. #else
  356. #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
  357. #endif /* TAINT */
  358. #endif /* CRIPPLED_CC */
  359.  
  360. #ifdef CRIPPLED_CC
  361. double str_gnum();
  362. #else /* !CRIPPLED_CC */
  363. #ifdef TAINT
  364. #define str_gnum(str) (Str = (str), tainted |= Str->str_tainted, \
  365.     (Str->str_nok ? Str->str_u.str_nval : str_2num(Str)))
  366. #else /* !TAINT */
  367. #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_u.str_nval : str_2num(Str)))
  368. #endif /* TAINT*/
  369. #endif /* CRIPPLED_CC */
  370. EXT STR *Str;
  371.  
  372. #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
  373.  
  374. #ifndef MSDOS
  375. #define STR_GROW(str,len) if ((str)->str_len < (len)) str_grow(str,len)
  376. #define Str_Grow str_grow
  377. #else
  378. /* extra parentheses intentionally NOT placed around "len"! */
  379. #define STR_GROW(str,len) if ((str)->str_len < (unsigned long)len) \
  380.         str_grow(str,(unsigned long)len)
  381. #define Str_Grow(str,len) str_grow(str,(unsigned long)(len))
  382. #endif /* MSDOS */
  383.  
  384. #ifndef BYTEORDER
  385. #define BYTEORDER 0x1234
  386. #endif
  387.  
  388. #if defined(htonl) && !defined(HTONL)
  389. #define HTONL
  390. #endif
  391. #if defined(htons) && !defined(HTONS)
  392. #define HTONS
  393. #endif
  394. #if defined(ntohl) && !defined(NTOHL)
  395. #define NTOHL
  396. #endif
  397. #if defined(ntohs) && !defined(NTOHS)
  398. #define NTOHS
  399. #endif
  400. #ifndef HTONL
  401. #if (BYTEORDER != 0x4321) && (BYTEORDER != 0x87654321)
  402. #define HTONS
  403. #define HTONL
  404. #define NTOHS
  405. #define NTOHL
  406. #define MYSWAP
  407. #define htons my_swap
  408. #define htonl my_htonl
  409. #define ntohs my_swap
  410. #define ntohl my_ntohl
  411. #endif
  412. #else
  413. #if (BYTEORDER == 0x4321) || (BYTEORDER == 0x87654321)
  414. #undef HTONS
  415. #undef HTONL
  416. #undef NTOHS
  417. #undef NTOHL
  418. #endif
  419. #endif
  420.  
  421. #ifdef CASTNEGFLOAT
  422. #define U_S(what) ((unsigned short)(what))
  423. #define U_I(what) ((unsigned int)(what))
  424. #define U_L(what) ((unsigned long)(what))
  425. #else
  426. unsigned long castulong();
  427. #define U_S(what) ((unsigned int)castulong(what))
  428. #define U_I(what) ((unsigned int)castulong(what))
  429. #define U_L(what) (castulong(what))
  430. #endif
  431.  
  432. CMD *add_label();
  433. CMD *block_head();
  434. CMD *append_line();
  435. CMD *make_acmd();
  436. CMD *make_ccmd();
  437. CMD *make_icmd();
  438. CMD *invert();
  439. CMD *addcond();
  440. CMD *addloop();
  441. CMD *wopt();
  442. CMD *over();
  443.  
  444. STAB *stabent();
  445. STAB *genstab();
  446.  
  447. ARG *stab2arg();
  448. ARG *op_new();
  449. ARG *make_op();
  450. ARG *make_match();
  451. ARG *make_split();
  452. ARG *rcatmaybe();
  453. ARG *listish();
  454. ARG *maybelistish();
  455. ARG *localize();
  456. ARG *fixeval();
  457. ARG *jmaybe();
  458. ARG *l();
  459. ARG *fixl();
  460. ARG *mod_match();
  461. ARG *make_list();
  462. ARG *cmd_to_arg();
  463. ARG *addflags();
  464. ARG *hide_ary();
  465. ARG *cval_to_arg();
  466.  
  467. STR *str_new();
  468. STR *stab_str();
  469.  
  470. int do_each();
  471. int do_subr();
  472. int do_match();
  473. int do_unpack();
  474. int eval();        /* this evaluates expressions */
  475. int do_eval();        /* this evaluates eval operator */
  476. int do_assign();
  477.  
  478. SUBR *make_sub();
  479.  
  480. FCMD *load_format();
  481.  
  482. char *scanpat();
  483. char *scansubst();
  484. char *scantrans();
  485. char *scanstr();
  486. char *scanreg();
  487. char *str_append_till();
  488. char *str_gets();
  489. char *str_grow();
  490.  
  491. bool do_open();
  492. bool do_close();
  493. bool do_print();
  494. bool do_aprint();
  495. bool do_exec();
  496. bool do_aexec();
  497.  
  498. int do_subst();
  499. int cando();
  500. int ingroup();
  501.  
  502. void str_replace();
  503. void str_inc();
  504. void str_dec();
  505. void str_free();
  506. void stab_clear();
  507. void do_join();
  508. void do_sprintf();
  509. void do_accept();
  510. void do_pipe();
  511. void do_vecset();
  512. void savelist();
  513. void saveitem();
  514. void saveint();
  515. void savelong();
  516. void savesptr();
  517. void savehptr();
  518. void restorelist();
  519. void repeatcpy();
  520. HASH *savehash();
  521. ARRAY *saveary();
  522.  
  523. EXT char **origargv;
  524. EXT int origargc;
  525. EXT line_t subline INIT(0);
  526. EXT STR *subname INIT(Nullstr);
  527. EXT int arybase INIT(0);
  528.  
  529. struct outrec {
  530.     line_t  o_lines;
  531.     char    *o_str;
  532.     int     o_len;
  533. };
  534.  
  535. EXT struct outrec outrec;
  536. EXT struct outrec toprec;
  537.  
  538. EXT STAB *stdinstab INIT(Nullstab);
  539. EXT STAB *last_in_stab INIT(Nullstab);
  540. EXT STAB *defstab INIT(Nullstab);
  541. EXT STAB *argvstab INIT(Nullstab);
  542. EXT STAB *envstab INIT(Nullstab);
  543. EXT STAB *sigstab INIT(Nullstab);
  544. EXT STAB *defoutstab INIT(Nullstab);
  545. EXT STAB *curoutstab INIT(Nullstab);
  546. EXT STAB *argvoutstab INIT(Nullstab);
  547. EXT STAB *incstab INIT(Nullstab);
  548. EXT STAB *leftstab INIT(Nullstab);
  549. EXT STAB *amperstab INIT(Nullstab);
  550. EXT STAB *rightstab INIT(Nullstab);
  551. EXT STAB *DBstab INIT(Nullstab);
  552. EXT STAB *DBsub INIT(Nullstab);
  553.  
  554. EXT HASH *defstash;        /* main symbol table */
  555. EXT HASH *curstash;        /* symbol table for current package */
  556. EXT HASH *debstash;        /* symbol table for perldb package */
  557.  
  558. EXT STR *curstname;        /* name of current package */
  559.  
  560. EXT STR *freestrroot INIT(Nullstr);
  561. EXT STR *lastretstr INIT(Nullstr);
  562. EXT STR *DBsingle INIT(Nullstr);
  563.  
  564. EXT int lastspbase;
  565. EXT int lastsize;
  566.  
  567. EXT char *curpack;
  568. EXT char *filename;
  569. EXT char *origfilename;
  570. EXT FILE * VOLATILE rsfp;
  571. EXT char buf[1024];
  572. EXT char *bufptr;
  573. EXT char *oldbufptr;
  574. EXT char *oldoldbufptr;
  575. EXT char *bufend;
  576.  
  577. EXT STR *linestr INIT(Nullstr);
  578.  
  579. EXT int record_separator INIT('\n');
  580. EXT int rslen INIT(1);
  581. EXT char *ofs INIT(Nullch);
  582. EXT int ofslen INIT(0);
  583. EXT char *ors INIT(Nullch);
  584. EXT int orslen INIT(0);
  585. EXT char *ofmt INIT(Nullch);
  586. EXT char *inplace INIT(Nullch);
  587. EXT char *nointrp INIT("");
  588.  
  589. EXT bool preprocess INIT(FALSE);
  590. EXT bool minus_n INIT(FALSE);
  591. EXT bool minus_p INIT(FALSE);
  592. EXT bool minus_a INIT(FALSE);
  593. EXT bool doswitches INIT(FALSE);
  594. EXT bool dowarn INIT(FALSE);
  595. EXT bool doextract INIT(FALSE);
  596. EXT bool allstabs INIT(FALSE);    /* init all customary symbols in symbol table?*/
  597. EXT bool sawampersand INIT(FALSE);    /* must save all match strings */
  598. EXT bool sawstudy INIT(FALSE);        /* do fbminstr on all strings */
  599. EXT bool sawi INIT(FALSE);        /* study must assume case insensitive */
  600. EXT bool sawvec INIT(FALSE);
  601. EXT bool localizing INIT(FALSE);    /* are we processing a local() list? */
  602.  
  603. #ifdef CSH
  604. char *cshname INIT(CSH);
  605. int cshlen INIT(0);
  606. #endif /* CSH */
  607.  
  608. #ifdef TAINT
  609. EXT bool tainted INIT(FALSE);        /* using variables controlled by $< */
  610. #endif
  611.  
  612. #ifndef MSDOS
  613. #define TMPPATH "/tmp/perl-eXXXXXX"
  614. #else
  615. #define TMPPATH "/tmp/plXXXXXX"
  616. #endif /* MSDOS */
  617. EXT char *e_tmpname;
  618. EXT FILE *e_fp INIT(Nullfp);
  619.  
  620. EXT char tokenbuf[256];
  621. EXT int expectterm INIT(TRUE);        /* how to interpret ambiguous tokens */
  622. EXT VOLATILE int in_eval INIT(FALSE);    /* trap fatal errors? */
  623. EXT int multiline INIT(0);        /* $*--do strings hold >1 line? */
  624. EXT int forkprocess;            /* so do_open |- can return proc# */
  625. EXT int do_undump INIT(0);        /* -u or dump seen? */
  626. EXT int error_count INIT(0);        /* how many errors so far, max 10 */
  627. EXT int multi_start INIT(0);        /* 1st line of multi-line string */
  628. EXT int multi_end INIT(0);        /* last line of multi-line string */
  629. EXT int multi_open INIT(0);        /* delimiter of said string */
  630. EXT int multi_close INIT(0);        /* delimiter of said string */
  631.  
  632. FILE *popen();
  633. /* char *str_get(); */
  634. STR *interp();
  635. void free_arg();
  636. STIO *stio_new();
  637.  
  638. EXT struct stat statbuf;
  639. EXT struct stat statcache;
  640. STAB *statstab INIT(Nullstab);
  641. STR *statname;
  642. EXT struct tms timesbuf;
  643. EXT int uid;
  644. EXT int euid;
  645. EXT int gid;
  646. EXT int egid;
  647. UIDTYPE getuid();
  648. UIDTYPE geteuid();
  649. GIDTYPE getgid();
  650. GIDTYPE getegid();
  651. EXT int unsafe;
  652.  
  653. #ifdef DEBUGGING
  654. EXT VOLATILE int debug INIT(0);
  655. EXT int dlevel INIT(0);
  656. EXT int dlmax INIT(128);
  657. EXT char *debname;
  658. EXT char *debdelim;
  659. #define YYDEBUG 1
  660. #endif
  661. EXT int perldb INIT(0);
  662.  
  663. EXT line_t cmdline INIT(NOLINE);
  664.  
  665. EXT STR str_undef;
  666. EXT STR str_no;
  667. EXT STR str_yes;
  668.  
  669. /* runtime control stuff */
  670.  
  671. EXT struct loop {
  672.     char *loop_label;        /* what the loop was called, if anything */
  673.     int loop_sp;        /* stack pointer to copy stuff down to */
  674.     jmp_buf loop_env;
  675. } *loop_stack;
  676.  
  677. EXT int loop_ptr INIT(-1);
  678. EXT int loop_max INIT(128);
  679.  
  680. EXT jmp_buf top_env;
  681.  
  682. EXT char * VOLATILE goto_targ INIT(Nullch); /* cmd_exec gets strange when set */
  683.  
  684. struct ufuncs {
  685.     int (*uf_val)();
  686.     int (*uf_set)();
  687.     int uf_index;
  688. };
  689.  
  690. EXT ARRAY *stack;        /* THE STACK */
  691.  
  692. EXT ARRAY * VOLATILE savestack;        /* to save non-local values on */
  693.  
  694. EXT ARRAY *tosave;        /* strings to save on recursive subroutine */
  695.  
  696. EXT ARRAY *lineary;        /* lines of script for debugger */
  697.  
  698. EXT ARRAY *pidstatary;        /* keep pids and statuses by fd for mypopen */
  699.  
  700. EXT int *di;            /* for tmp use in debuggers */
  701. EXT char *dc;
  702. EXT short *ds;
  703.  
  704. double atof();
  705. long time();
  706. struct tm *gmtime(), *localtime();
  707. char *mktemp();
  708. char *index(), *rindex();
  709. char *strcpy(), *strcat();
  710.  
  711. #ifdef EUNICE
  712. #define UNLINK unlnk
  713. int unlnk();
  714. #else
  715. #define UNLINK unlink
  716. #endif
  717.  
  718. #ifndef SETREUID
  719. #ifdef SETRESUID
  720. #define setreuid(r,e) setresuid(r,e,-1)
  721. #define SETREUID
  722. #endif
  723. #endif
  724. #ifndef SETREGID
  725. #ifdef SETRESGID
  726. #define setregid(r,e) setresgid(r,e,-1)
  727. #define SETREGID
  728. #endif
  729. #endif
  730.